from django.shortcuts import render
from django.http import HttpResponse

from .models import Question, Answer


def index(request):
    return render(request, "chat/index.html")


def detail_list(request):
    context = {
        "qs": Question.objects.all(),
    }
    return render(request, "chat/detail_list.html", context)


def detail(request, question_id):
    context = {
        "q": Question.objects.get(pk=question_id),
    }
    return render(request, "chat/detail.html", context)
